home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
F1 Licenseware
/
F1 Licenseware - Volume 1.iso
/
disks
/
050a.dms
/
050a.adf
/
EXAMPLE_PROGRAMS
/
example23_1.AMOS
/
example23_1.amosSourceCode
Wrap
AMOS Source Code
|
1992-02-26
|
1KB
|
36 lines
'================
'Example23_1.Amos
'================
Rem a quick look at LEFT$, RIGHT$ and MID$
Flash Off : Curs Off : Hide : Paper 0 : Cls 0
Rem The contents of A$ is the text we are going to be working on
'---------------------------------------------------------------
A$="TESTING AMOS"
Pen 4 : Print A$
Print
Pen 5
Rem let's do LEFT$ first. We want to cut out the word TESTING from A$
Rem and put it into B$. We will then PRINT B$ to the screen.
Rem As TESTING is 7 letters long from the LEFT, we do this:
'------------------------------------------------------------
B$=Left$(A$,7)
Print "LEFT$ 7=";B$
Print
Rem Now RIGHT$. Let's cut out the word AMOS
'------------------------------------------
B$=Right$(A$,4)
Print "RIGHT$ 4=";B$
Print
Rem MID$ allows you to define the start and the length of the piece you
Rem wish to extract. The 1 is the start character and the 4 the length.
'----------------------------------------------------------------------
B$=Mid$(A$,1,4)
Print "MID$ 1,4=";B$